import 'package:flutter/material.dart';

class ThemeProvider extends ChangeNotifier {
  String _themeMode = 'system'; // 主题模式

  ThemeMode getThemeMode() {
    switch (_themeMode) {
      case 'dark':
        return ThemeMode.dark;
      case 'light':
        return ThemeMode.light;
      default:
        return ThemeMode.system;
    }
  }

  set themeMode(val) {
    if (_themeMode != val) {
      _themeMode = val;
      notifyListeners();
    }
  }

  ThemeData lightTheme = ThemeData(primarySwatch: Colors.blue); // 浅色模式下的主题
  ThemeData darkTheme = ThemeData(primarySwatch: Colors.blueGrey); // 暗色模式下的主题
}
